package com.yycx.app.boot.handler.app;


import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.interceptor.IndexInterceptor;
import com.yycx.module.user.provider.service.SysSliderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * APP首页接口
 *
 * @author zyf
 */
@Component("appIndexHandler")
public class AppIndexHandler implements IndexInterceptor {

    @Autowired
    private SysSliderService sliderService;



    @Override
    public EntityMap complete(EntityMap params, Long userId) {
        EntityMap result = new EntityMap();
        //轮播图
        List<EntityMap> sliderList = sliderService.listBySliderType(1, 5);

        //弹窗 广告
        EntityMap alertSlider = sliderService.getOneBySliderType(200);
        result.put("alertSlider", alertSlider);
        result.put("sliderList", sliderList);


        return result;
    }
}
